<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript">
var myArr=new Array();
var i=0;
function addmyArr()
{
	myArr.push(i);
	i++;
	
	alert(myArr.length);	
	10
	}
	
function removeMyArr()
{
	alert(myArr.length);	
	 myArr.splice(i,1);
	i--;
	alert(myArr.length);	
	
	}

</script>
</head>
<body>
<button type="button" onClick="addmyArr()">添加元素</button>
<button type="button" onClick="removeMyArr()">删除元素</button>
</body>
</html>